package com.newtouch.cq.security.config.common;//package cn.com.mcc.security.com.newtouch.cq.lang.config.common;
//
//import cn.com.mcc.security.com.newtouch.cq.lang.config.MccOauth2Properties;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.context.properties.EnableConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.authentication.AuthenticationManager;
//import org.springframework.security.com.newtouch.cq.lang.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.com.newtouch.cq.lang.config.annotation.web.builders.WebSecurity;
//import org.springframework.security.com.newtouch.cq.lang.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.com.newtouch.cq.lang.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
//import javax.servlet.ServletContext;
//
//@Configuration
//@EnableConfigurationProperties({ MccOauth2Properties.class })
//@EnableWebSecurity
//class CommonWebSecurityConfigration extends WebSecurityConfigurerAdapter {
//
//	@Autowired
//	protected MccOauth2Properties oauth2Properties;
//
//	@Autowired(required = false)
//	protected ServletContext servletContext;
//
//	@Override
//	protected void configure(HttpSecurity http) throws Exception {
//		http.authorizeRequests().antMatchers(oauth2Properties.getUrlPermitAll().toArray(new String[] {})).permitAll()
//				.anyRequest().authenticated().and().exceptionHandling().accessDeniedPage("/admin/auth/failure").and()
//				.formLogin().and().httpBasic().and().csrf().disable()
//				;
//	}
//
//	@Override
//	public void configure(WebSecurity web) throws Exception {
//		web.ignoring().antMatchers("/static/**", "**.html", "**.js");
//	}
//
//	@Bean
//	public PasswordEncoder passwordEncoder() {
//		return new BCryptPasswordEncoder();
//	}
//
//	@Bean
//	@Override
//	public AuthenticationManager authenticationManagerBean() throws Exception {
//		return super.authenticationManagerBean();
//	}
//
//}
